<?php
namespace app\index\controller;

class File extends UserBase{
	// 文件上传
	public function upload(){
		$model = model('File');
		$update_type = $this->_get('update_type', '', 'all');
		$allow_ext   = $model->getAllowExt($update_type);
		// 限制上传大小
		$model->limit_size = 1024000;
		$data = $model->upload($this->_user_id, $allow_ext, '');
		if($data){
			json('上传成功！', $data);
		}else{
			json('上传失败->' . $model->tips_info, '', 400);
		}
	}
}